import 'package:json_annotation/json_annotation.dart';

part 'channel.g.dart';

@JsonSerializable()
class Channel extends Object {
  @JsonKey(name: 'id')
  int id;

  @JsonKey(name: 'name')
  String name;

  @JsonKey(name: 'avatar')
  String avatar;

  @JsonKey(name: 'parent_id')
  int parentId;

  @JsonKey(name: 'page_url')
  String pageUrl;

  @JsonKey(name: 'page_type')
  String pageType;

  @JsonKey(name: 'params')
  String params;

  @JsonKey(name: 'children')
  List<dynamic> children;

  @JsonKey(name: 'share_title')
  String shareTitle;

  @JsonKey(name: 'share_avatar')
  String shareAvatar;

  @JsonKey(name: 'share_content')
  String shareContent;

  Channel(
    this.id,
    this.name,
    this.avatar,
    this.parentId,
    this.pageUrl,
    this.pageType,
    this.params,
    this.children,
    this.shareTitle,
    this.shareAvatar,
    this.shareContent,
  );

  factory Channel.fromJson(Map<String, dynamic> srcJson) =>
      _$ChannelFromJson(srcJson);
}
